<template>
  <div>
    <div  class="app-container">
      <div class="filter-container">
        <el-tabs type="border-card">
          <el-tab-pane lazy :label="data_list.all">
            <index @numberbh='numberbh' :all_type='0' lazy></index>
          </el-tab-pane>
          <el-tab-pane lazy :label="data_list.day_die">
            <index @numberbh='numberbh' :all_type='1' lazy></index>
          </el-tab-pane>
          <el-tab-pane lazy :label="data_list.day_str">
            <index @numberbh='numberbh' :all_type='2' lazy></index>
          </el-tab-pane>
          <el-tab-pane lazy :label="data_list.info">
            <index @numberbh='numberbh' :all_type='3' lazy></index>
          </el-tab-pane>

          <el-tab-pane lazy :label="data_list.mrks">
            <index @numberbh='numberbh' :all_type='5' lazy></index>
          </el-tab-pane>

          <el-tab-pane lazy :label="data_list.mrjs">
            <index @numberbh='numberbh' :all_type='6' lazy></index>
          </el-tab-pane>

          <el-tab-pane lazy :label="data_list.zrks">
            <index @numberbh='numberbh' :all_type='7' lazy></index>
          </el-tab-pane>

          <el-tab-pane lazy :label="data_list.zrjs">
            <index @numberbh='numberbh' :all_type='8' lazy></index>
          </el-tab-pane>

          <el-tab-pane lazy :label="data_list.die">
            <index @numberbh='numberbh' :all_type='4' lazy></index>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>



  </div>
</template>

<script>
  import index from './activity_index/index.vue'
  import api from '@/api/vote/activity.js'
  export default {

    components: { index },
    data() {
      return {
        data_list:{
          all:'全部',
          day_die:'今日结束',
          day_str:'今日开始',
          info:'正在进行',
          die:'已结束',
          mrks:'明日开始',
          mrjs:'明日结束',
          zrks:'昨日开始',
          zrjs:'昨日结束'
        }
      }
    },

    // 进入页面加载数据
    created() {
      this.get_data_list()
    },
    methods: {
      numberbh(){
        // childValue就是子组件传过来的值
        this.get_data_list()
      },
      get_data_list(){

        api.get_activity_number_date({

        }).then(res => {
          this.data_list = {
            all:'全部('+res.data.all+')',
            day_die:'今日结束('+res.data.day_die+')',
            day_str:'今日开始('+res.data.day_str+')',
            info:'正在进行('+res.data.info+')',
            die:'已结束('+res.data.die+')',
            mrks:'明日开始('+res.data.mrks+')',
            mrjs:'明日结束('+res.data.mrjs+')',
            zrks:'昨日开始('+res.data.zrks+')',
            zrjs:'昨日结束('+res.data.zrjs+')',
          }
        })


      }
    }
  }
</script>

<style>
</style>
